$def with(user, all_week, all_week_user, table_width, year, half, start_year, today_and_half)
<!DOCTYPE html>
$:render.header()

<style>
    body { padding-top: 70px; }
    table.user {
        width:$table_width;
    } 
</style>

        <div class="container bs-docs-container">
            <div class="row">

                <div align="center">
                <form class="form-inline" role="form" action="/statistics_week" method="POST">
                    <div class="form-group">
                        <select class="form-control" name="select_year" id="select_year">
                            $ y = start_year
                            $while y <= today_and_half["start_date"].year:
                                $if year == y:
                                    <option value="$y" selected="selected">$y</option>
                                $else:
                                    <option value="$y">$y</option>
                                $ y += 1
                        </select>
                    </div>
                    <div class="form-group">
                        <select class="form-control" name="select_half" id="select_half">
                            $ hh = ['寒假', '上半年', '暑假', '下半年']
                            $for i in range(1, 5):
                                $if half == i:
                                    <option value="$i" selected="selected">$hh[i-1]</option>
                                $else:
                                    <option value="$i">$hh[i-1]</option>
                        </select>
                    </div>
                        <button type="submit" class="btn btn-default">Submit</button>
                    </div>
                    </div>
                </form>
                </div>
                <br>

                <table class="table table-bordered table-hover table-striped user">
                    <thead>
                        <tr>
                            <th>$year年
                            $if half == 2:
                                上半年
                            $elif half == 4:
                                下半年
                            $elif half == 1:
                                寒假
                            $elif half == 3:
                                暑假
                            </th>
                            $for u in user:
                                <th><a href="http://poj.org/userstatus?user_id=$u.poj_name" target="_blank">$u.user_name<br>$u.class1</a></th>
                        </tr>
                    </thead>
                    <tbody>
                        $ i = 0
                        $for aw in all_week:
                            <tr>
                            <td>$aw[2] $aw[0]~$aw[1]</td>
                            $for awu in all_week_user[i]:
                                <td>$awu[1][0]</td>
                            </tr>
                            $ i += 1
                    </tbody>
                </table>
            </div>
        </div>



$:render.footer()
